// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIPlaintextEditor.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    ///This Source Code Form is subject to the terms of the Mozilla Public
    /// License, v. 2.0. If a copy of the MPL was not distributed with this
    /// file, You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("b74fb158-1265-4102-91eb-edd0136b49f8")]
	public interface nsIPlaintextEditor
	{
		
		/// <summary>
        /// The length of the contents in characters.
        /// XXX change this type to 'unsigned long'
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetTextLengthAttribute();
		
		/// <summary>
        /// The maximum number of characters allowed.
        /// default: -1 (unlimited).
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetMaxTextLengthAttribute();
		
		/// <summary>
        /// The maximum number of characters allowed.
        /// default: -1 (unlimited).
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetMaxTextLengthAttribute(int aMaxTextLength);
		
		/// <summary>
        ///Get and set the body wrap width.
        ///
        /// Special values:
        /// 0 = wrap to window width
        /// -1 = no wrap at all
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetWrapWidthAttribute();
		
		/// <summary>
        ///Get and set the body wrap width.
        ///
        /// Special values:
        /// 0 = wrap to window width
        /// -1 = no wrap at all
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetWrapWidthAttribute(int aWrapWidth);
		
		/// <summary>
        /// Similar to the setter for wrapWidth, but just sets the editor
        /// internal state without actually changing the content being edited
        /// to wrap at that column.  This should only be used by callers who
        /// are sure that their content is already set up correctly.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetWrapColumn(int aWrapColumn);
		
		/// <summary>
        ///Get and set newline handling.
        ///
        /// Values are the constants defined above.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetNewlineHandlingAttribute();
		
		/// <summary>
        ///Get and set newline handling.
        ///
        /// Values are the constants defined above.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetNewlineHandlingAttribute(int aNewlineHandling);
		
		/// <summary>
        /// Inserts a string at the current location,
        /// given by the selection.
        /// If the selection is not collapsed, the selection is deleted
        /// and the insertion takes place at the resulting collapsed selection.
        ///
        /// @param aString   the string to be inserted
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void InsertText([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aStringToInsert);
		
		/// <summary>
        /// Insert a line break into the content model.
        /// The interpretation of a break is up to the implementation:
        /// it may enter a character, split a node in the tree, etc.
        /// This may be more efficient than calling InsertText with a newline.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void InsertLineBreak();
	}
	
	/// <summary>nsIPlaintextEditorConsts </summary>
	public class nsIPlaintextEditorConsts
	{
		
		// <summary>
        // only plain text entry is allowed via events
        // </summary>
		public const long eEditorPlaintextMask = 0x0001;
		
		// <summary>
        // enter key and CR-LF handled specially
        // </summary>
		public const long eEditorSingleLineMask = 0x0002;
		
		// <summary>
        // text is not entered into content, only a representative character
        // </summary>
		public const long eEditorPasswordMask = 0x0004;
		
		// <summary>
        // editing events are disabled.  Editor may still accept focus.
        // </summary>
		public const long eEditorReadonlyMask = 0x0008;
		
		// <summary>
        // all events are disabled (like scrolling).  Editor will not accept focus.
        // </summary>
		public const long eEditorDisabledMask = 0x0010;
		
		// <summary>
        // text input is limited to certain character types, use mFilter
        // </summary>
		public const long eEditorFilterInputMask = 0x0020;
		
		// <summary>
        // use mail-compose editing rules
        // </summary>
		public const long eEditorMailMask = 0x0040;
		
		// <summary>
        // allow the editor to set font: monospace on the root node
        // </summary>
		public const long eEditorEnableWrapHackMask = 0x0080;
		
		// <summary>
        // bit for widgets (form elements)
        // </summary>
		public const long eEditorWidgetMask = 0x0100;
		
		// <summary>
        // this HTML editor should not create css styles
        // </summary>
		public const long eEditorNoCSSMask = 0x0200;
		
		// <summary>
        // besides, anchors of HTML are not clickable.
        // </summary>
		public const long eEditorAllowInteraction = 0x0400;
		
		// <summary>
        // see bug 530367 for the detail.
        // </summary>
		public const long eEditorDontEchoPassword = 0x0800;
		
		// <summary>
        // from the text control's content node.
        // </summary>
		public const long eEditorRightToLeft = 0x1000;
		
		// <summary>
        // when this flag is set, the internal direction of the editor is LTR.
        // </summary>
		public const long eEditorLeftToRight = 0x2000;
		
		// <summary>
        // when this flag is set, the editor's text content is not spell checked.
        // </summary>
		public const long eEditorSkipSpellCheck = 0x4000;
		
		// <summary>
        // The valid values for newlines handling.
        // Can't change the values unless we remove
        // use of the pref.
        // </summary>
		public const long eNewlinesPasteIntact = 0;
		
		// 
		public const long eNewlinesPasteToFirst = 1;
		
		// 
		public const long eNewlinesReplaceWithSpaces = 2;
		
		// 
		public const long eNewlinesStrip = 3;
		
		// 
		public const long eNewlinesReplaceWithCommas = 4;
		
		// 
		public const long eNewlinesStripSurroundingWhitespace = 5;
	}
}
